import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		// main1();

		String str_0 = "你们好吗?????";

//		String str = new String(str_0.getBytes("GB2312"),"GB2312");
//		
//		System.out.println(str);

		String path = "D:\\";
		File file = new File(path + "tree_data2.json");
		if (!file.exists()) {
			file.createNewFile();
		}
		FileOutputStream fos = new FileOutputStream(file);
		fos.write(str_0.getBytes("GBK"));
		fos.flush();
		fos.close();
	}

	private static void main1() throws IOException {
		// System.out.println(ArrayUtils.toString("".split(",")));
		// System.out.println("".split(",").length);
		Process process = Runtime.getRuntime().exec("cmd cd E:/");
		// Process process1 = Runtime.getRuntime().exec("cmd /k dir");
		InputStream is = process.getInputStream();
		// OutputStream os = process.getOutputStream();
		// OutputStreamWriter osw = new OutputStreamWriter(os);
		// BufferedWriter bw = new BufferedWriter(osw);
		//
		// 得到相应的控制台输出信息
		InputStreamReader bi = new InputStreamReader(is);
		BufferedReader br = new BufferedReader(bi);
		String message;
		message = br.readLine();
		while (message != null && !"".equals(message)) {
			// 将信息输出
			System.out.println(message);
			message = br.readLine();
		}
		if (process != null) {
			process.destroy();
			process = null;
		}

	}
}
